package cn.iocoder.yudao.module.exam.dal.mysql.paperquestionbank;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.exam.dal.dataobject.paperquestionbank.PaperQuestionBankDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.exam.controller.admin.paperquestionbank.vo.*;

/**
 * 试卷题库关联 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PaperQuestionBankMapper extends BaseMapperX<PaperQuestionBankDO> {

    default PageResult<PaperQuestionBankDO> selectPage(PaperQuestionBankPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PaperQuestionBankDO>()
                .eqIfPresent(PaperQuestionBankDO::getPaperId, reqVO.getPaperId())
                .eqIfPresent(PaperQuestionBankDO::getBankId, reqVO.getBankId())
                .orderByDesc(PaperQuestionBankDO::getId));
    }

}